package gateway.api.annotation;

/**
 * @author Jin Zheng
 * @since 1.0 2020-09-09
 */
public enum GatewayType
{
	/**
	 * http/https
	 */
	HTTP("http"),

	/**
	 * websocket
	 */
	WEBSOCKET("websocket"),

	/**
	 * mqtt
	 */
	MQTT("mqtt"),

	/**
	 * mqtt client
	 */
	MQTT_CLIENT("mqtt-client"),

	ANY("any");

	private String name;

	GatewayType(String name)
	{
		this.name = name;
	}

	public static GatewayType getType(String name)
	{
		for (GatewayType type : GatewayType.values())
		{
			if (type.getName().equalsIgnoreCase(name))
				return type;
		}
		return ANY;
	}

	public String getName()
	{
		return name;
	}

}
